// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the “License”);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// <https://apache.org/licenses/LICENSE-2.0>.
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an “AS IS” BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// This file was generated by scripts/generate-benchmark.py, do not modify!

const dataBig = [{
  a: '-0x1192E1511E17A9515CF3D9E149C11C403041E88DEED9555BF64B02BF137AD5DC5D7',
  b: '-0x744197B',
  r: '0x26B2AE62F58B27FC4A3D215E46DBBD746E11BBC4B078197E8373D378B196',
}, {
  a: '0xB6B160796A0CFAA2264BD45DC7706E8688497FCEEB7B21866',
  b: '-0xF2756DECB77BC1D6F120F0D9F4358',
  r: '-0xC0E570F6315D4B1378CE',
}, {
  a: '-0x7997ABAA4D55AB163EB6577500636DC111E3203E56461669EEA376054FF45696AB67',
  b: '0xED7D7C77300266F0CB12B434AD71F72F541A1',
  r: '-0x8311BD5483475CEC2165CCDA0BA2603',
}, {
  a: '0xFD7127E3B3ECE43B19DA83279BAEDE0F2968E9E45E',
  b: '-0xAB722A46397F3C269D00FF639BA23776E95A082ACCD8078D',
  r: '0x0',
}, {
  a: '0x1EA8437A1DB6F9CBF073C8FBC071779A6722482DE70CB252072604ABC095',
  b: '-0x56CCB92B2AFB62D',
  r: '-0x5A6B084A2B0CE478D63B49B3EC03F1E9F3386B5BED105',
}, {
  a: '-0x5D779B41B8784A84889FAAF90D90505A2EA671660070C180E75E59B346EFE',
  b: '-0xD6B62AAD9C40488840A70636BECF7C6CA89C17DBDE3A0D0',
  r: '0x6F70D0B7547F3D',
}, {
  a: '-0x3F7D40A8B1E6B081202D07AB0D27E08D133EA239A5A8AD08B861B06B0',
  b: '0x29CFE9F14613C1D3179CA9BAA367909A',
  r: '-0x184B87E717CA3300EC87D928DC',
}, {
  a: '0x412C90180A1BA53F77AE93A32F69A6F57FE0C532CE8F637AD415F0',
  b: '0x2418C9E8DED0A3FD5C1E5D51CE9B0EE165F',
  r: '0x1CE378261F882FE9B56B',
}, {
  a: '-0x2A2272E28EDC86616CF3CF9D9B2E525467F73229C9F8067282BBC5',
  b: '-0x10C762071C8',
  r: '0x282DC38874790B7F063F70479268DA2943D497EAFEE1',
}, {
  a: '0xB92B322A74AC235B06E9FF795002ADA44A5BC67AFF9599F7F41DF54530',
  b: '0x30DE0E6FD19BA87155347F156D63F08',
  r: '0x3CA097BEEB81B5A00535CF6F3523',
}, {
  a: '0x2F81B880B4A63BF9CE40F10E4A012CA095772C8374F189BCE59AC339F382B',
  b: '-0xB519',
  r: '-0x4327D505851B34C858AA1FBDCAEB4A773F64656C45D3C1D9C3A93C647',
}, {
  a: '0x8C1E0E2D18B67F2641DEDA5C28506A82C1FC4C0763',
  b: '-0xF75EEFCE183D5EF88259',
  r: '-0x910153CD935F7E8E90EE40',
}, {
  a: '-0x676CC73D4D79407FB98AC94699A2679F285C3FBC8C595693656F2266680A1D40A6B6B9',
  b: '0xB3E909B414DDC1B4EBCD8DB5F016C31FD5AF7B81A3',
  r: '-0x932AA2D53485EEC7575E6E732BCF',
}, {
  a: '-0x1AFD0C26BD50E6A2145DF6260DDA1579EDEF58176675F381D95A5EBDB985869FCB',
  b: '0xFB23644E',
  r: '-0x1B82CC7BB94A63539E9130D584F1562D40D1A488F048E674EFD0C3B6EC',
}, {
  a: '-0xE74C9F17E854696E4C5BCB5F2C2D3A7D32F7979903889467D',
  b: '0x602F17CC645BB7C052F1441EEED67',
  r: '-0x2679E54C99B2CE62A1834',
}, {
  a: '0x6235B897549B64D8E1335275A716E6425DA80AB84A6898A766FF2B96B9875',
  b: '0xED',
  r: '0x6A154D549C333185CF9BE4697B3C617EC66142AAFB0A5D99D18C9B19A06',
}, {
  a: '0x6C64505FE6C66ECC7F18E87252A793B7596A7A6E91C847225E839440EEC58E968B641',
  b: '0x1667A',
  r: '0x4D67FDB9326CFAE57DA97D9F13325CC1E41F4B7447C56A95DD07537EABE8DA8B0',
}, {
  a: '-0x3B6E2772339C28A48A767ECB335CC6A19E99B44045D041774',
  b: '0x5B2D88BEAC4A',
  r: '-0xA6DCC38A98871E64109AB155D37AD08C30285',
}, {
  a: '-0x65AFF7CD92ACE7A393C1BB4FF0F3056D203D47C8DEA',
  b: '-0x442A78D3DD337E63',
  r: '0x17DE42DA22BC8A26C1946363480A',
}, {
  a: '-0xF12686DFD5FF2BE1549C11A9C6E6D72E0C4734B1AC30737D',
  b: '-0xA5C87A4B336D58F07E6986CA1F95EC24',
  r: '0x174619ABBCE8DE86A',
}, {
  a: '0x97F16209DE38DFAAEDCDD7687499487FE14724954CF20627B',
  b: '-0x5BD616F038AD36ABA56DD55F0F54428EBF',
  r: '-0x1A78D24D9FC73A08',
}, {
  a: '0xAA7D7652DDB11534A0FB9CB3221561EAC9FA981F1103C8B7122',
  b: '-0xF52FBDAC6D10663F3ED2C25EC7CC4D02400EF6',
  r: '-0xB2025E0A675DD',
}, {
  a: '0xAD5A5DCC347B93B7903EB2285C0FAEBD3160AAAC0EA98A',
  b: '0xF245E8AF2845F247C',
  r: '0xB72CCB5A6A31AC82FF9EFFC312421',
}, {
  a: '0xAD696D9A7FEE00F506360354A71B621EDAB09F64B3B60956F00B2B4C9E1ED',
  b: '0x4D327EE8C02DD09919E2',
  r: '0x23F109D2DD450529E02BCD7CCFE8BCE5CE35174343',
}, {
  a: '-0x2097AEB1933BD7AD3A1807BAE62ADE1868E697BCE625EEEAAABCD5C738031D389010',
  b: '-0xFC37',
  r: '0x2114E6CF399CEAA156C98890D257098B8A143E5CF3FD795B043FEBBA7CE5DF52',
}, {
  a: '0xD1A83EFE64C2626832490C47B0F4C7E161E214E336',
  b: '-0x7',
  r: '-0x1DF376B6A0AE0E0EE29CB89C86FE65B27BB2954507',
}, {
  a: '0x5C90BBF8F579C17FE5A673DFD0715B24F1EB46663EA7',
  b: '0x7EAF496A90144BA5A78D868',
  r: '0xBB0D8643F997D0599C4FA',
}, {
  a: '0x17AB915E52F11CE8C64F6C3E710DB5473EFD2ED0BCB9C91FB1FD0',
  b: '0xA9932579B6F4B9CD2882',
  r: '0x23BBE093468D8A1780CE3F009F557F72F',
}, {
  a: '-0x8C39F7DBE66B99BA2C30337C47AAD4E6C3BA802CAFC5D3FA3A1B15D272B9990966586',
  b: '-0x6F1E4647272B63272BCA8965590139C716CCF47DADC6BB7D3',
  r: '0x1430F99021AB4A778859E',
}, {
  a: '-0x111C05FF2B9B4A107FD8E7173271F1EE03E7DD38880',
  b: '-0x7B3D6C',
  r: '0x238A66094DB8E98D3145EC85E897FF23956AA',
}, {
  a: '-0xE5A7B918D10ED46232FB80F0BD9354DDCB3F059CC319',
  b: '-0x6C8FCFB2CA5655BC7D0409912C630AA0',
  r: '0x21D8D09587FED',
}, {
  a: '0xD17B15BBF90F7CB55EF90F1D60A32FD6C6AEDBB56311B271DCE9D3B57EB60970E',
  b: '0x5D31C0DFD186D86182',
  r: '0x23F6ECBAA1C438378958B472DFD66D7CCC19A8F9A55F2932',
}, {
  a: '-0xE601FB25E399B49DA4DFE629E057131413C218C4780A2A904CDC4D2EF6692E07CD063',
  b: '-0xCA3A182639',
  r: '0x1232AF853CD76F6B5C86EAF5FBBC1C10A20B29F5D28CE45506C46FCEE499',
}, {
  a: '-0xF7FFDBF5BC350111C40DBEC79AD4BB033A9434F0B574B90CCF54AAD5364696E05086B',
  b: '-0xD34674',
  r: '0x12C7F9655EAE17BBBC41E6095C10D7316A54AEAD63388947272FB9794F14685C',
}, {
  a: '-0xD22F3699422C00F424AC76EDE7640B8C3CECD25EDE93A',
  b: '0x84B4022E4F8A30955F228C04AC848E7ED0A6BA6E396',
  r: '-0x195',
}, {
  a: '-0x7ACFB70CEA0B8092E3E6C8D696B3A19724B2E9BBA541F9E948FC8D37EC9E0321',
  b: '-0xD06628DE528F6BA88437FE4B39B3F4AF800822D895117376',
  r: '0x96DCEFEC0A2B5A3B',
}, {
  a: '0x142D4775550C94E7CBDDA4E90DB0B13E49A4EA717CCB0DA3D77235A38B6CF44',
  b: '0x301A70FF1931A43447A6B4FA72153779C236782CC2B6',
  r: '0x6B61011ED14251F929B',
}, {
  a: '0x1B0B855BB15EE5012AD81240765A09579AFA4650053703B',
  b: '-0xD3E1C7A2B5E6A62CA7210BC',
  r: '-0x20AD22D3FDCFA22FE01A755A',
}, {
  a: '0xF350FD60D3D4DBBB286D5D9D1CBFBC841C57FF7528AB2730DA91891B454910D13037',
  b: '0x65B233D',
  r: '0x264805197C2A740446D617D50506CFC18C18A8F114D739B6C8BEA0FF2FFED9',
}, {
  a: '0x5EC6A3B0DA7E74C9039B73574EF7B18E871E05B429E72E9A82F5DF',
  b: '-0x244CA192A38145E7B7E2D7B1165A8023AAE4D2506D8148A6',
  r: '-0x29C6787',
}, {
  a: '0xF632F030AF5550B7CF61F5804B41E3AC0C65C0542FAE0A540BDD405EC',
  b: '0x8A9E77E96B579D53C6F2620339CCEC869E0',
  r: '0x1C6AD6BEF1676B01F092371',
}, {
  a: '0x162EE0C26BDC9233FC2872B6FFE1C8464A1006033AEF0D',
  b: '-0x7EB10B96',
  r: '-0x2CD30DD45F055F6DE97AADA247CC0C3CEF6F1C',
}, {
  a: '0x2D850358DFB4E2F9A54B65DAC866E37C150EEDC90BB8AC14F',
  b: '0xF697D889748D1382EA4ED9F73A97931918AA',
  r: '0x2F418B26A1382',
}, {
  a: '0xF0534F3BB632537D307B25F5313E421CBBD91BDFF050A40F402B6F5B5FF89',
  b: '-0xED9C542',
  r: '-0x102ECC47270C6355B519B5010764E968440DBAE1DDCEBF7682D60DC',
}, {
  a: '0x1821052BB0CCA62360A6117F5B8283C7DBBAFEF81CDB38',
  b: '0x65EF3AB8A6332D970A8F85ECD4C196C3949E',
  r: '0x3C9912A983',
}, {
  a: '-0x622FDC558A9988BC4F4D331313F3744170FB7E9777',
  b: '0x94496125AD6D0204EE26F516CFC131EADB7941BBB6',
  r: '0x0',
}, {
  a: '-0xF9639DE6B59DD3FEF8F9E6678221F5FB78978CF2D41FF4D606233C28D33D9FC822',
  b: '-0x142EC7',
  r: '0xC5B47CD598B81F5BD58B056BE0725E18668118B8191E6A618226A1DF29E47',
}, {
  a: '0x158C93858606516F205B756ED28C0BFD3BA2E1AD141354F3F0841E8',
  b: '-0xB97127DAEB4D00299A2020BE9',
  r: '-0x1DBF8D9CE97B1ED039D535B310216C',
}, {
  a: '-0xE24A3C87BC221E2D305847C93467263F8F0340136D865E6CC',
  b: '0xE0E28C5928480E1CDD9A1A9E350CF533322366511E5DE13',
  r: '-0x101',
}, {
  a: '0xD1F8BE7CF75035CC0317EB43FD84958728B7D62B9C3F3F42834327F5104D978F481C',
  b: '0xC04B827B6E5FC3C955226D686803626D',
  r: '0x1178864122581011F51A7E8C716AB59F4A061',
}, {
  a: '-0xE6F1D60CDE0984776F6504F54429538B1DFFE31FC26B3FC932A54F444CF7F89',
  b: '-0x75641BDAC390658714A008D51',
  r: '0x1F7A1AD11247C66A8EC849F4CFBD6CE17099264',
}, {
  a: '0xE24B3A4F5BF7C49532139B0238188AC03F2F36750028C5B9F50B223',
  b: '-0x26BC14A8DC8E',
  r: '-0x5D7971F36AD109690884B33D1AB44670CD326A62331D',
}, {
  a: '-0xD611653BF2FD73CD3750CE54385346B4BAC433018C305DAAD798D9912C7F',
  b: '0xCE014B3923EED445F32EEC717903D2E2ABF8331044CD2D',
  r: '-0x10A0508C1F15814',
}, {
  a: '-0xA05DA6308E3EC265B23BECCD464D24E2CF6D312244B68E6DFB5BDAA26',
  b: '-0x498D0DCAAD1AC9088587E80C4E30B96D1CA255CB607B8F35',
  r: '0x22E2A72CFD',
}, {
  a: '-0xFF9DA0E08F06BEBB40F2A18E3C8884D9FD098757268361E9156A48FF8C9C24AC37731',
  b: '-0x3E243CC3',
  r: '0x41D0A9A9DC43B74758BB48BEAA60ED7285113C5906AB1B96BB3591E8740365',
}, {
  a: '0x8A12512B49CD4708D76B55A4F6A3BE2FE069EA26B75641E1229606ED5DA85',
  b: '-0xA667EE6125C886CACCD528A0BC470F',
  r: '-0xD468FEAA92EFD8DCAC026EE1F545EEB',
}, {
  a: '-0x83813EFBFEA40FA9D290E190257C28092A899C1A6F6744C',
  b: '-0x81BB273914DF8ECA0E',
  r: '0x103801137A810989B2F5858E8BD692',
}, {
  a: '0x8E2D0E788A2121355547D03A5F01751B7F6B985C85497E05F89AAB2',
  b: '0xD1',
  r: '0xAE260A60339A7E6AF8FE8BEA681F2EAD515B5EC22B38F28E0CFD2',
}, {
  a: '-0xF8A3A638B69DE93B2CB35CD994C3F3E2DBC3CF8597',
  b: '-0xF1C4377A8CDE3DD1663B7A',
  r: '0x107470407CAF5F055975E',
}, {
  a: '0xC372421A3DFC2DB0EE526B7ECA59B3743C8F3C09D2A8E295',
  b: '0x7FF14D94157B4C7788D85F059A19B687ECEF16C6A6BE87E',
  r: '0x18',
}, {
  a: '-0xBDF3B2EB2AEC82DB173954656F535DE2C6D6AE5B3DF21',
  b: '-0x54DC896DCE',
  r: '0x23D0642CE163BD56EC76C9FB9DCA42DDE72D',
}, {
  a: '0x12D3FBC1FD1254BABE8C93C8C043CAD9D4C859CF3A66449551131C71E157E',
  b: '0xFE8D6945833002275DAD1345F543D75D61BC42C',
  r: '0x12EF64E7E48524C5772569',
}, {
  a: '-0x583435F8999CD42515E5402B67B691D686E29F07D397D9',
  b: '-0x10156F87D75AF3CFFF283F691',
  r: '0x57BEA81855D45069A0EB5F',
}, {
  a: '0xE7A1628B35AC3D066AA58968EB8C2F3E5C782351DE546A91',
  b: '-0x5688B4D426C574728254AB3F3D10C',
  r: '-0x2AD3FDE01718617B897C',
}, {
  a: '0xD828464B298C46AB6253B1F993858760C5D7B74D3AC2238AF5655A905',
  b: '-0xB4F7EB3',
  r: '-0x131C75292C11C194719F58868D2AB53F49D590B7E6E42316EB0',
}, {
  a: '-0xD8287071487DF495238D9B85508E25C2B764C53BA304128F00AA9',
  b: '-0x490839241943D95AA8FA81EADE101EA06B60FA5255AE3',
  r: '0x2F5B3339D',
}, {
  a: '-0xA42FC39FC1F9CAD708EFE048BD12092DED3BCCE8133BC',
  b: '-0x258438783792BBC216D49F3D06F6BFFAE9D1AF734BA',
  r: '0x460',
}, {
  a: '0x7C70DD2823A7A6C24741A49F0404C1A50DBD9448B3A9100E855E1C87C99FA07AB6FA',
  b: '0x6FA895EF0D1BFB2F82A11CE51A85',
  r: '0x11D4E5DB54F3D0E9D8456EBD95776C46A541CAAD5',
}, {
  a: '0xA6CC5F384787F7C5DE165EDD3BC5E1BFEB8097428C6BA9FEF08D21890755A47B60',
  b: '-0xAB53DC4ADAE97261B73422E',
  r: '-0xF93B79F6A3D5A7C3E5B4A9A15D7746174438A2ACE40',
}, {
  a: '-0xAF57E79111754B877C99EB56869F4CC8C6C0C064E988E',
  b: '-0xB0F6E9876DCB4CD68EAE20A14992323A',
  r: '0xFDA7A47BFC3DD',
}, {
  a: '-0xD3E2436B01692E8ACDEB03AC9B57191C9B5245B87E8C4467B8FA87ED7635CD11712',
  b: '0x75852EED75962EF2B9B43096DC1762BE91F6F3B14BB27A8',
  r: '-0x1CD8E872322D5E0C04B05',
}, {
  a: '0xDD3D423E704D5BA7B4C4325ACA108EA5D3FF86AFDB',
  b: '-0x3833F604A731C3F1A3C8288ECE32CC18DAA',
  r: '-0x3EFBA235',
}, {
  a: '-0xF2187BF4EFD65B026965DB92DDE098DED5E83F72423D5122B29F4933566C13DB5C',
  b: '-0x3B5C3E916D4136',
  r: '0x414128B57E7BEEF86F8D6503B1EA8D9DF943DECAE0655595B70AF',
}, {
  a: '0x194FFC896A1EB927EE46F988228CD97E0E2E558F64567C0236514',
  b: '-0x4B7C4114180EC1DE1DB32A636F04CC61F6',
  r: '-0x55D8223761CE2CB0D2E',
}, {
  a: '-0x1D5A8A0F764BED436AF18D15A40C6DB130877D34663DB699',
  b: '-0xB406904F69C21821178DD9028ACE',
  r: '0x29BDD29ABDB31E7ECA8C',
}, {
  a: '0x8887C6FA77B7EE2958643BD97788CC355BBF6331DA308F0F59EAE8A',
  b: '0x9D5BFFCA',
  r: '0xDE1D47285A52500C70F8B1E4E098A275F8BD944CADDB160',
}, {
  a: '-0x1915EB097D1D5E7339A705B70A9F2C5F33E821B3EF8A7F',
  b: '-0x6D56E52FFA85F8902A15D4C704D695A',
  r: '0x3ABBD8E52F4C3F7',
}, {
  a: '0xD29322975D49270D17B9CDE2C29839DE9FF32A0CB456C27C5C1F217FC',
  b: '0x31ABECB8CCF29027FE69C8F81970C93F',
  r: '0x43D456C041626458006780CCB3',
}, {
  a: '-0x33CED2D35167ECADE947BCEEAA90563C2553FBB67815AEE622',
  b: '0x35370A4',
  r: '-0xF93B1DAF72D46D9C49F7F9B1F45460F607AB65D46D4',
}, {
  a: '-0x7B39DDB4A960CD0D7BA2B94C4116B6EE066EDEE38B576FF28',
  b: '0xBE64F569365B8624375202',
  r: '-0xA5AFDD3458D0C61D3BB77DF2B05',
}, {
  a: '0x491BEF8745BF1145F4F7FAB6DA9F99606BB98D9CCBB0E7E541FEB8CC0635',
  b: '-0xD027D50F5C022F6210F0E85619C1679CC764845FF72210F',
  r: '-0x59E9C77C472A4',
}, {
  a: '0x59F8E2FA9617B3F39D25566A641BB510FF12D27FE38CCD6F2CBB9749AF822B24144BA8',
  b: '0x68875F3B5ADB58A73DC6964B670CF8DAA',
  r: '0xDC59846FD8EEC822C611CA53A2D592ECF6F86',
}, {
  a: '0xFA1F0D90A8DF59C1AB4BD963D3BB310422650DF2D62AB1ADDCCFDEC3',
  b: '0xD6813CBAFC51843B4D6185D8BAA23E967C283',
  r: '0x12A819F9EE0E84347D0C',
}, {
  a: '-0xE34FAD0B293E6081520613FB323E511FA234F55AE2552B02382875552594AD',
  b: '-0x3017907BA3892714D4BC653D9A23CD',
  r: '0x4BA019547D5D41038100282B049904B29',
}, {
  a: '-0x69EA5BC3F248574636D05330E836F09D4DF5A72B795C6BEEC47D79EA90E578B',
  b: '0xEA305',
  r: '-0x73C7AAD3B6EC2DC28C12E36B9C69023D5741C6A3BEFF62DB445C0C5B55',
}, {
  a: '0x894C2EA75665E78E5ACF480F1E0CF688ED50011FEC189821AD83A462C02C5988F4',
  b: '0x9FA',
  r: '0xDC3134F8526E1AF3F075869C275F90983D71AC675158284E114362A5FD78A47',
}, {
  a: '-0x5203B1FB6080ADD46FCCBEA663E0B525A4F00F3565E2FCD966AA',
  b: '-0x7351AF5AAB7B81A',
  r: '0xB610EBC7BB7C31BAB5625F0AFC378F7774AAF',
}, {
  a: '0xB2377AD49249D5A05D91DEC5EE387AD7DD888F6191637AF9E7DDE207DDEA',
  b: '0x6EBDC63803DB3AF6EF3BA28F',
  r: '0x19BFB84FCFEA844990A6D8E189322700782BF',
}, {
  a: '0x974569DCD06BEB87A878F9244220A47266E7D4F7DF72BCBDFFB3B792FC2E61',
  b: '-0x9',
  r: '-0x10CED2DFA561530F12B81BAEB203A07E7D36341B8A9AF886E385BF1054E8B5',
}, {
  a: '-0x842CFAE124B1B942A2B0AF4C2294D44CBAD9E5CD02469FE2111459AE055',
  b: '0x382D940D404458C0A633AE109E93BE07',
  r: '-0x25A511CBB88317A520FA700F1DA8',
}, {
  a: '-0xABC3096CB26AB6C24BD563AC5428BD18775193A3D30C6F5D58C',
  b: '-0x256F7AC1BFC97ACF8FC55050384DC860E69639',
  r: '0x4969511AD2D647',
}, {
  a: '-0xBF694F3497AFE5E6B4C0F1DD024EF886F7ABB93FAF2DA38659565D',
  b: '-0x1A93F7ABECA83FE9BB2A067CF5ABFC07FBFD388E65',
  r: '0x733ADF26FF558',
}, {
  a: '-0x40ECA2C47F710D9E4D617DB2C2EA07F48EC00DE66256E2F9FEA4EC85',
  b: '0xF4511DC52CF242D3A26',
  r: '-0x44076DA550D7D553DB279F4ED575224455068',
}, {
  a: '0x678F2ED88FC7C1D7B7C7BBD14A95BBC90114BBB3F6',
  b: '0x50B26888CE83BFE12E09DE3F2B5BA5E533940877',
  r: '0x148',
}, {
  a: '-0xEDEACB1044257460F6DA18139D86CC77406836ABCE933C0E5B4EC',
  b: '-0x334A56D2427BA97A11351D1A26D1BA',
  r: '0x4A37D4BDC81408F2151D1349',
}, {
  a: '-0xA911F7B056D3E72EB03B15869D7924339608BEEA63E9664474FC',
  b: '-0x86C12E742B3AF539C8375665543BE9D6971664958A24AD1',
  r: '0x14130E',
}, {
  a: '0x19F2343D6321CDC56D29927BDD3A97745F22760ECB2FB114444AF8BD9F357B810',
  b: '-0xFBE04811B2032DA91',
  r: '-0x1A5EF48171ADBC08ADAACA12F079803D79062D6CDC666FE3',
}, {
  a: '0x213E020F0C71724E64116773C1071C1959CC7FEC2E4A87',
  b: '0x63B97F62E0AA',
  r: '0x5555C8ABFFA79D9CFE4D83C64D57246035',
}, {
  a: '-0x811E1463723656D0D5356661F68C5357444FAF1D4CAD',
  b: '-0x44C0D3A65FE40364BD9A4AA0FD1C6C423BFDCE302',
  r: '0x1E0C',
}, {
  a: '-0x1A417F51E5B632CDB96BD6614563C4088CB421DEB7EA40',
  b: '0x5789267599AD533',
  r: '-0x4CC926A7F46BAB1E6EECF29044B9ED4',
}];

const dataSmall = [{
  a: '0x6A6CDA6E5',
  b: '-0xF378A',
  r: '-0x6FE6',
}, {
  a: '-0x42F6A8C964',
  b: '-0x98495DF0450',
  r: '0x0',
}, {
  a: '0x609724685A7997B',
  b: '0xF66E18CC4',
  r: '0x645767',
}, {
  a: '0xCDBD1A8F07499E',
  b: '0xCA23',
  r: '0x1048FD0FA3E',
}, {
  a: '0xE53336EFA331DD6',
  b: '0xE5B4460',
  r: '0xFF702ABA',
}, {
  a: '0x2EACC1D2FB64C',
  b: '0x8F4FA44',
  r: '0x536058',
}, {
  a: '0x6098D2512AF7A',
  b: '-0x7',
  r: '-0xDCCB054BCFEC',
}, {
  a: '0x767379DA37B613F',
  b: '0xAB7C6C',
  r: '0xB0D3E2FCD',
}, {
  a: '0xB76FDC503',
  b: '0x6B8D66D',
  r: '0x1B4',
}, {
  a: '-0x7CEE3099AED4F80',
  b: '0xF974',
  r: '-0x80358F3F82A',
}, {
  a: '0xC136725E67',
  b: '0xE309',
  r: '0xD9DCCC',
}, {
  a: '0xDBCFD48324',
  b: '-0xF18',
  r: '-0xE902785',
}, {
  a: '-0xAA03E2491759B9',
  b: '-0x9',
  r: '0x12E3FCB2C9B4A2',
}, {
  a: '0xBA8D546FE',
  b: '0x39',
  r: '0x345D90F6',
}, {
  a: '-0x26794B34DDD',
  b: '0xEFD89AD7',
  r: '-0x291',
}, {
  a: '0xAB968406C10',
  b: '-0x4',
  r: '-0x2AE5A101B04',
}, {
  a: '0x6B13979E18F2C562',
  b: '-0x90C',
  r: '-0xBD5F393E83AAB',
}, {
  a: '0x29D362F47CC60',
  b: '0x8ED9DA14E',
  r: '0x4AF4',
}, {
  a: '0x12FDCF72D4795403',
  b: '0xF32CC',
  r: '0x13FE39B0316',
}, {
  a: '0xCEB0A8CCA30AB1E',
  b: '-0xBB3C6A',
  r: '-0x11A99485D6',
}, {
  a: '0xEC2A6555C04',
  b: '-0x90',
  r: '-0x1A3D997B4E',
}, {
  a: '0xA289DCE5FA',
  b: '-0xE3E68',
  r: '-0xB6944',
}, {
  a: '-0x751073399',
  b: '-0x151A96A9E8',
  r: '0x0',
}, {
  a: '-0xBCC687B5C95',
  b: '0x2F26',
  r: '-0x400FCA48',
}, {
  a: '-0x76300E9EC53E95A',
  b: '-0xE9',
  r: '0x81DAB4DEC9553',
}, {
  a: '-0x22BF5F92F69C8C',
  b: '-0x4',
  r: '0x8AFD7E4BDA723',
}, {
  a: '0xB5F4BE523D7FC',
  b: '0x7',
  r: '0x19FE6454E436D',
}, {
  a: '0x742EFF6901',
  b: '-0xC12A3D8C7E',
  r: '0x0',
}, {
  a: '0x43C456CBBA4',
  b: '0x12C128E',
  r: '0x39D05',
}, {
  a: '0x98B2144DA999C7A1',
  b: '0xA',
  r: '0xF450207C428FA5C',
}, {
  a: '-0x9D08557E7AFE',
  b: '-0x8CFB305C',
  r: '0x11D25',
}, {
  a: '0x3C568129BC8',
  b: '0xC885B',
  r: '0x4D0808',
}, {
  a: '-0xD82D6EEF335',
  b: '0x597EF52CDE',
  r: '-0x26',
}, {
  a: '0xC24C06FDA35E6ECF',
  b: '0x85B45',
  r: '0x17403D98F53E',
}, {
  a: '0xD7F2B6A5B3AEF8B',
  b: '0xB',
  r: '0x13A1B3836D6CFF5',
}, {
  a: '-0x5EC5F02F9DB4',
  b: '0xF',
  r: '-0x6517669930C',
}, {
  a: '0x7AA4685EE',
  b: '-0x578176C',
  r: '-0x166',
}, {
  a: '-0xCB8DB7D33F11C',
  b: '-0x4968EE',
  r: '0x2C5D899E',
}, {
  a: '0xC154EA8B4478',
  b: '-0xEEAB11640A0',
  r: '-0xC',
}, {
  a: '-0x3E017BDDE6D65',
  b: '-0x68279D',
  r: '0x9867242',
}, {
  a: '0xF14536E5B161',
  b: '0x6F3FCEA343D',
  r: '0x22',
}, {
  a: '-0xD4DFAABC2',
  b: '-0x996F5E38',
  r: '0x16',
}, {
  a: '0x998133F5974FDF2A',
  b: '-0x5E78A739',
  r: '-0x19FF84104',
}, {
  a: '-0x376CDBC7B30825',
  b: '-0x883FA0325C',
  r: '0x6823',
}, {
  a: '0xFA489FD38B',
  b: '0xC2D7282876F',
  r: '0x0',
}, {
  a: '0x3DCF00B609940',
  b: '0x5718B5CDB',
  r: '0xB5AC',
}, {
  a: '-0xA1230C5C3D',
  b: '-0xEA82CCE059',
  r: '0x0',
}, {
  a: '-0x97B265E9296F62',
  b: '0x473A429',
  r: '-0x221373BF',
}, {
  a: '0x7C65B03B45',
  b: '0xCF4C07E7E',
  r: '0x9',
}, {
  a: '0x42D842722',
  b: '0x4C5868E',
  r: '0xE0',
}, {
  a: '-0xEDAE1DF6C7',
  b: '0xB591',
  r: '-0x14F1E21',
}, {
  a: '0x8EE4D770E7ED',
  b: '-0xA36AE321C4',
  r: '-0xDF',
}, {
  a: '0x1AEB8B293',
  b: '-0x2F14F',
  r: '-0x925F',
}, {
  a: '-0x319B492493',
  b: '0xB7C9FDCE90',
  r: '0x0',
}, {
  a: '0x9A09A279106D3',
  b: '-0x5',
  r: '-0x1ECEBA18367C3',
}, {
  a: '-0xDD1CF105C7B',
  b: '0xE5ED7DFA1',
  r: '-0xF6',
}, {
  a: '-0xB33E54078E0A2F1',
  b: '0xD5C',
  r: '-0xD6AC41E81CCA',
}, {
  a: '-0x268B21E57',
  b: '-0x6024280',
  r: '0x66',
}, {
  a: '0xBD59D70C8E97',
  b: '0x244FBD1',
  r: '0x536F20',
}, {
  a: '0x1794F3DB7',
  b: '-0xE4A08BA5C2',
  r: '0x0',
}, {
  a: '0x682BCC1B1C',
  b: '0x3ED5A12',
  r: '0x1A86',
}, {
  a: '0x5157B0D5CED69',
  b: '0x2A120',
  r: '0x1EEF938C1',
}, {
  a: '-0x35BAA7276CAFC17',
  b: '0x60CD089AA',
  r: '-0x8E1799',
}, {
  a: '-0x749A5979E2A0F',
  b: '-0xE64',
  r: '0x81A4A9873D',
}, {
  a: '0x792DDBE69654',
  b: '-0x918FD1',
  r: '-0xD51E3F',
}, {
  a: '-0x972BF90EA887',
  b: '-0x6605F1CF',
  r: '0x17B53',
}, {
  a: '-0x60C72A94F59A1AB',
  b: '-0x9675',
  r: '0xA4AA82D235C',
}, {
  a: '-0x94C148C8F1E0725C',
  b: '0x2142D36',
  r: '-0x478EBF5358',
}, {
  a: '0x1908AB91E011B',
  b: '0x6',
  r: '0x42C1C985002F',
}, {
  a: '0x15BD0D0D372FD1B',
  b: '-0x9E8DC247',
  r: '-0x23194CE',
}, {
  a: '-0x58BFDC7AFB829',
  b: '0xA',
  r: '-0x8DFFC72B2C04',
}, {
  a: '0x651425847',
  b: '0x243D2C2CCB9',
  r: '0x0',
}, {
  a: '0x6C41367BE1D0F20',
  b: '-0x2',
  r: '-0x36209B3DF0E8790',
}, {
  a: '-0x998E053FC5F5F',
  b: '0xE',
  r: '-0xAF7DBCDB2B62',
}, {
  a: '0x5ABBC300CB053',
  b: '0xFFC34',
  r: '0x5AD1502C',
}, {
  a: '-0xEBBF67F8C7686B',
  b: '0x17D',
  r: '-0x9E67137773D7',
}, {
  a: '0xA8747C82F8AF88',
  b: '-0x89F352486B',
  r: '-0x1389B',
}, {
  a: '-0x4AA4CFE79D6',
  b: '-0xFA29',
  r: '0x4C62E57',
}, {
  a: '-0x7139BDE7C64DCC',
  b: '0x7FCE5013C4',
  r: '-0xE2CB',
}, {
  a: '-0xC009116EC12B',
  b: '-0x789373F7FF1',
  r: '0x19',
}, {
  a: '0x1D96AB5B06920',
  b: '0x14B98',
  r: '0x16D7DD571',
}, {
  a: '-0xFCF6ACD2333CC09',
  b: '0x2134C',
  r: '-0x79E34F3AA99',
}, {
  a: '-0x5ACCD83CBB68CAC0',
  b: '0xAF',
  r: '-0x84D3E317038647',
}, {
  a: '-0xF4510E4F321',
  b: '-0xD8F1F33',
  r: '0x1204C',
}, {
  a: '-0xCDB21F61BA3',
  b: '0xA8110',
  r: '-0x139513E',
}, {
  a: '-0xBAFFDB019',
  b: '0x99257',
  r: '-0x13896',
}, {
  a: '0xA87B83AA8',
  b: '0x5',
  r: '0x21B24D888',
}, {
  a: '0x6946FB1BE8',
  b: '-0x4B4BC77A08',
  r: '-0x1',
}, {
  a: '-0xA87F96584DF7F24B',
  b: '-0x4',
  r: '0x2A1FE596137DFC92',
}, {
  a: '-0xC2B3955F537C57',
  b: '0x6F3FAE637',
  r: '-0x1C0098',
}, {
  a: '0xD63A3BF329868A',
  b: '0xEDD3DAC81',
  r: '0xE698B',
}, {
  a: '-0xCDE8AC0347AE63',
  b: '-0x45376855A',
  r: '0x2F9901',
}, {
  a: '0x2CA4EC8E3',
  b: '0xC9EDC956E8C',
  r: '0x0',
}, {
  a: '0x33F407E78',
  b: '0xB3A468210D3',
  r: '0x0',
}, {
  a: '-0x6E1C10654CD481',
  b: '0x2E180A3B68',
  r: '-0x26389',
}, {
  a: '0xD7A9F6B01DC',
  b: '0x6C463CA82',
  r: '0x1FD',
}, {
  a: '0x285907416320D',
  b: '0x57C',
  r: '0x75B5B08469',
}, {
  a: '0x43DEA2D58AB7D6',
  b: '-0x44037E9B0',
  r: '-0xFF754',
}, {
  a: '-0xC6FAA4C3A870AF',
  b: '0x78F14',
  r: '-0x1A52E5B5DF',
}, {
  a: '0xB4D9F16CA5E0',
  b: '-0x6',
  r: '-0x1E2452E770FA',
}];

import JSBI from '../dist/jsbi.mjs';
const JSBigInt = JSBI.BigInt;

let errorCount = 0;

const dataBigNative = [];
const dataBigJsbi = [];
const dataSmallNative = [];
const dataSmallJsbi = [];

function hexParseN(s) {
  if (s.charCodeAt(0) === 0x2D) return -BigInt(s.slice(1));
  return BigInt(s);
}
function parseNative(d) {
  if (d.b) {
    return {a: hexParseN(d.a), b: hexParseN(d.b), r: hexParseN(d.r)};
  }
  return {a: hexParseN(d.a), r: hexParseN(d.r)};
}
function hexParse(s) {
  if (s.charCodeAt(0) === 0x2D) {
    const result = JSBigInt(s.slice(1));
    result.sign = true;
    return result;
  }
  return JSBigInt(s);
}
function parseJSBI(d) {
  if (d.b) {
    return {a: hexParse(d.a), b: hexParse(d.b), r: hexParse(d.r)};
  }
  return {a: hexParse(d.a), r: hexParse(d.r)};
}
function prepareData(src, dstNative, dstJsbi) {
  for (let i = 0; i < src.length; i++) {
    const d = src[i];
    dstNative.push(parseNative(d));
    dstJsbi.push(parseJSBI(d));
  }
}
prepareData(dataBig, dataBigNative, dataBigJsbi);
prepareData(dataSmall, dataSmallNative, dataSmallJsbi);


function testNative(data, reps) {
  for (let i = 0; i < data.length; i++) {
    const d = data[i];
    const r = d.a / d.b;
    if (d.r !== r) {
      console.log('Input A:  ' + d.a.toString(16));
      console.log('Input B:  ' + d.b.toString(16));
      console.log('Result:   ' + r.toString(16));
      console.log('Expected: ' + d.r.toString(16));
      console.log('Op: /');
      errorCount++;
    }
  }
  let r;
  const t1 = Date.now();
  for (let j = 0; j < reps; j++) {
    for (let i = 0; i < data.length; i++) {
      const d = data[i];
      r = d.a / d.b;
    }
  }
  // Confuse the compiler into thinking that the loop is needed :-)
  const d = data[data.length - 1];
  if (d.r !== r) throw new Error('no dead code elimination please');
  return Date.now() - t1;
}


function testJsbi(data, reps) {
  for (let i = 0; i < data.length; i++) {
    const d = data[i];
    const r = JSBI.divide(d.a, d.b);
    if (!JSBI.equal(r, d.r)) {
      console.log('Input A:  ' + d.a.toString(16));
      console.log('Input B:  ' + d.b.toString(16));
      console.log('Result:   ' + r.toString(16));
      console.log('Expected: ' + d.r.toString(16));
      console.log('Op: divide');
      errorCount++;
    }
  }
  let r;
  const t1 = Date.now();
  for (let j = 0; j < reps; j++) {
    for (let i = 0; i < data.length; i++) {
      const d = data[i];
      r = JSBI.divide(d.a, d.b);
    }
  }
  // Confuse the compiler into thinking that the loop is needed :-)
  const d = data[data.length - 1];
  if (!JSBI.equal(r, d.r)) throw new Error('no dead code elimination please');
  return Date.now() - t1;
}


const kRepsBig = 10000;
const kRepsSmall = 30000;

console.log('Testing divide:');
console.log('Native/big:   ' + testNative(dataBigNative, kRepsBig));
console.log('JSBI/big:     ' + testJsbi(dataBigJsbi, kRepsBig));
console.log('Native/small: ' + testNative(dataSmallNative, kRepsSmall));
console.log('JSBI/small:   ' + testJsbi(dataSmallJsbi, kRepsSmall));

if (errorCount !== 0) {
  console.error('Finished with ' + errorCount + ' errors.');
  // Support both d8 (`quit`) and Node.js (`process.exit`).
  (typeof quit !== 'undefined' ? quit : process.exit)(1);
}
